package com.developer.platform.controller;

import com.veeker.core.exceptions.BusinessException;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：qiaoliang
 * @date ：2020-10-19
 */
@RestController
public class ErrorController {

    /**
     * 重新抛出异常
     */
    @RequestMapping("/api/error")
    public void rethrow(HttpServletRequest request) {
        throw ((BusinessException) request.getAttribute("error"));
    }

}
